home *** CD-ROM | disk | FTP | other *** search
- #include "my color.h"
- pascal Boolean MyModalFilter(DialogPtr,EventRecord *,short *);
-
- DoAboutBox()
-
- {
- short itemHit;
- WindowPtr myWindow;
-
- myWindow = GetNewDialog(ABOUT_BOX, nil, (WindowPtr) -1);
- do
- {
- ModalDialog (MyModalFilter, &itemHit);
-
- }
- while (itemHit != 1);
- DisposDialog (myWindow);
- } /*DoAboutBox*/
-
- /* function MyFilter (theDialog: DialogPtr; var theEvent: EventRecord;*/
- /* var itemHit: Integer): Boolean; */
-
- pascal Boolean MyModalFilter(theDialog,theEvent,itemHit)
- DialogPtr theDialog;
- EventRecord *theEvent;
- short *itemHit;
-
- {
- short theType;
- Handle theItem;
- Rect theBox;
- long finalTicks;
-
- if (((theEvent->message & charCodeMask) == 13) || /*carriage return*/
- ((theEvent->message & charCodeMask) == 3)) /*enter*/
- {
- GetDItem (theDialog, 1, &theType, &theItem, &theBox);
- HiliteControl((ControlHandle)theItem, 1);
- Delay(8, &finalTicks);
- HiliteControl((ControlHandle)theItem, 0);
- *itemHit = 1;
- return(true);
- } /*if BitAnd...*/
- else
- return(false);
- } /* MyModalFilter */
-
-